package com.cetcs.kmga.common;

import com.github.miemiedev.mybatis.paginator.domain.PageList;

import java.util.List;

/**
 * @author Adaihao
 *         Date: 11-12-5
 * @since v1.0
 */
public class Page {
    public Page(PageList pageList) {
        this.content = pageList;
        this.totalRecord = pageList.getPaginator().getTotalCount();
        this.totalPageCount = pageList.getPaginator().getTotalPages();
        this.pageNumber = pageList.getPaginator().getPage();
    }
    public Page() {
    }

    /**
     * 获取当前页的所有元素列表。
     *
     * @return 当前页的所有元素列表
     */
    private List content;

    /**
     * 获取总的元素数目。
     *
     * @return 总的元素数目
     */
    private int totalRecord;

    private int pageNumber;

    /**
     * 获得每页显示的条目数目
     *
     * @return 每页显示的条目数目
     */
    private int pageSize;

    public List getContent() {
        return content;
    }

    public void setContent(List content) {
        this.content = content;
    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(int totalPageCount) {
        this.totalPageCount = totalPageCount;
    }

    /**
     * 返回总页数。

     *
     * @return 总页数
     */
    private int totalPageCount;

}
